from rest_framework import serializers
from serializers.article_serializer import ArticleSimpleSerializerView
from serializers.label_serializer import QuestionSimpleSerializerView, ReplySimpleSerializerView
from serializers.recruit_serializer import EnterpriseSimpleSerializerView
from serializers.usersimpleserializers import LabelSimpleSerializerView
from user.models import User

# 定义用户模型类序列化器
class UserSeialiser(serializers.ModelSerializer):
    labels = LabelSimpleSerializerView(many=True)
    questions = QuestionSimpleSerializerView(many=True)
    answer_question = ReplySimpleSerializerView(many=True)
    collected_articles = ArticleSimpleSerializerView(many=True)
    enterpises = EnterpriseSimpleSerializerView(many=True)

    class Meta:
        model = User
        fields = '__all__'
        extra_kwargs = {'password': {'write_only': True}}



